<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="no">
<meta name="format-detection" content="telephone=no">
<title>个人设置</title>
<link rel="stylesheet" type="text/css" href="{OSSURL}public/mobile/css/new_yab.css" />
<script type="text/javascript" src="{MODULE_URL}public/mobile/js/jquery-1.11.3.min.js?v=4.8"></script>
</head>
<style>
.common_list_imgtext6 li a .icon_text .right_arrow_icon {width: 30px;height: 44px;position: absolute;right: 0;top: 0;
background: url({MODULE_URL}public/mobile/img/right_arrow.png) no-repeat center;background-size: 9px 15px;}
.my_unseInfo_right {float: right;display: inline-block;background: url({MODULE_URL}public/mobile/img/right_arrow.png) no-repeat center;
width: 30px;height: 100%;background-size: 9px 15px;}
.user_info {position: fixed;left: 0;right: 0;top: 0;bottom: 0;-webkit-box-sizing: border-box;box-sizing: border-box;background-color: rgba(0,0,0,.53);
text-align: center;z-index: 9999;font-size: 20px;color: #fe6700;}
.user_info>div {position: absolute;left: 6%;right: 6%;top: 45px;padding: 0 20px;background-color: #fff;padding-bottom: 33px;padding-top: 10px;}
.user_name {text-align: left;color: #666;font-size: 14px;}
.btn {height: 44px;display: block;background-color: #7bb52d;font: 20px "黑体";text-align: center;color: #fff;cursor: pointer;}
.user_info>div>span {display: inline-block;width: 30px;height: 30px;background: #fff;font-size: 24px;color: #aaa;-webkit-border-radius: 100%;-moz-border-radius: 100%;-o-border-radius: 100%;border-radius: 100%;line-height: 30px;text-align: center;position: absolute;top: -15px;right: -15px;
font-family: 宋体b8b\4f53;cursor: default;}
.user_name > input {display: block;width: 100%;border-radius: 3px;height: 44px;padding: 0 10px;margin-bottom: 10px;border: 1px solid #ccc;-webkit-box-sizing: border-box;box-sizing: border-box;}
.user_name > select {display: block;width: 100%;height: 44px;border-radius: 3px;padding: 0 10px;margin-bottom: 10px;border: 1px solid #ccc;-webkit-box-sizing: border-box;
box-sizing: border-box;text-align: left;color: #666;font-size: 14px;}
.close_pupop_c {width: 200px; margin: 0 auto;}
.close_pupop_button {width: 90px;height: 30px;border-radius: 5px;line-height: 30px;font-size: 16px;text-align: center;}
.close_pupop_button_1 {background: #e74580;color: #fff;}
.close_pupop_button_2 {background: #56c454;color: #fff;margin-left: 20px;}
</style>
<body>
<div class="top_head_my">
    <a id="scroll">
        <div class="my_img">
            <img src="{php echo tomedia($_W['fans']['tag']['avatar']);}">
        </div>
        <div class="my_unseInfo">
            <div class="my_unseInfoName">{$userinfo['name']}</div>
            <div class="my_unseInfoDescribe">{$userinfo['mobile']}</div>
        </div>
        <div class="my_unseInfo_right"></div>
    </a>
</div>
<ul class="common_list_imgtext6">
    <div class="common_list_imgtext6GroupBox class_li">
        <li>
            <a href="{php echo $this->createMobileUrl('myfamily', array('schoolid' => $schoolid, 'id' => $userss), true)}">
                <div class="icon">
                    <img src="{MODULE_URL}public/mobile/img/parents_myHome.png">
                </div>
                <div class="icon_text">
                    我的家庭<div class="right_arrow_icon"></div>
                </div>
            </a>
        </li>
        <div class="li_line"></div>
        <li>
            <a id="scroll1">
                <div class="icon">
                    <img src="{MODULE_URL}public/mobile/img/parents_accountinfo.png">
                </div>
                <div class="icon_text">
                    聊天设置<div class="right_arrow_icon"></div>
                </div>
            </a>
        </li>
        <div class="li_line"></div>
        <li>
            <a href="javascript:;" onclick="cancel_wx_bind()">
                <div class="icon">
                    <img src="{MODULE_URL}public/mobile/img/parents_qxbd.png">
                </div>
                <div class="icon_text">
                    取消微信绑定<div class="right_arrow_icon"></div>
                </div>
            </a>
        </li>
    </div>
</ul>
<div class="blank"></div>
<div class="user_info" id="user_info" style="display:none;">
   <div style="border-radius: 5%;">
		<ul>
			<p>联系方式</p>
			<li class="user_name">
			真实姓名
				<input type="text" placeholder="请输入您的姓名" name ="name" id="name" value="{if !empty($userinfo['name'])}{$userinfo['name']}{/if}">
				
			</li>
			<li class="user_name">
			  手机号
				<input type="text" placeholder="请输入您的手机号" name ="mobile" id="mobile" value="{if !empty($userinfo['mobile'])}{$userinfo['mobile']}{/if}">
			</li>
		</ul>
		<div class="close_pupop_c">
			<div id="tijiao1" class="close_pupop_button close_pupop_button_1 float_l">确定</div>
			<div id="close" class="close_pupop_button close_pupop_button_2 float_l">取消</div>
		</div>
   </div>
</div>
<div class="user_info" id="user_info1" style="display:none;">
   <div style="border-radius: 5%;">
		<ul>
			<p>聊天设置</p>
			<li class="user_name">是否接收其他学生或家长的信息
				<select id="is_allowmsg">
					<option value="2" {if $it['is_allowmsg'] ==2}selected="selected"{/if}>允许</option>
					<option value="1" {if $it['is_allowmsg'] ==1}selected="selected"{/if}>拒绝</option>
				</select>
			</li>	
		</ul>
		<div class="close_pupop_c">
			<div id="tijiao2" class="close_pupop_button close_pupop_button_1 float_l">确定</div>
			<div id="close1" class="close_pupop_button close_pupop_button_2 float_l">取消</div>
		</div>
   </div>
</div>
<div class="top_height_blank70"></div>
{php include $this->template('footer');}
{php include $this->template('port');}
<script>
$("#scroll").on('click', function () {
	$('#user_info').show();
});
$("#close").on('click', function () {
	$('#user_info').hide();
});
$("#scroll1").on('click', function () {
	$('#user_info1').show();
});
$("#close1").on('click', function () {
	$('#user_info1').hide();
});
$("#tijiao1").on('click', function () {
	var userid =  $("#userid").val(); 
	var name = $("#name").val();
	var mobile = $("#mobile").val();
	var truthBeTold = window.confirm('确认要修改吗?'); 
	 data = {
		schoolid:"{$schoolid}",
		name:name,
		mobile:mobile,
		userid:"{$it['id']}",
		'json':''
	}

	reg=/^(0|86|17951)?(13[0-9]|15[012356789]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/;	
	if (name == "" || name == undefined || name == null) {
		jTips('请输入您的姓名！');
		return false;
	}
	if (mobile == "" || mobile == undefined || mobile == null || !reg.test(mobile)) {
		jTips('手机号有误或为空！');
		return false;
	}
	
	if (truthBeTold) {

	$.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'useredit'))}",data,
		function(data){
			if(data.result){
				jTips(data.msg);
				location.reload();
			}else{
				jTips(data.msg);
			}
		},'json');	
	} else $('#user_info').hide();	
});
$("#tijiao2").on('click', function () {
	var is_allowmsg = $("#is_allowmsg").val();
	var truthBeTold = window.confirm('确认要修改吗?'); 
	 data = {
		schoolid:"{$schoolid}",
		is_allowmsg:is_allowmsg,
		userid:"{$it['id']}",
		'json':''
	}
	if (is_allowmsg == "" || is_allowmsg == undefined || is_allowmsg == null) {
		jTips('请选择是否接收其他家长私聊');
		return false;
	}
	if (truthBeTold) {

	$.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'liaotian'))}",data,
		function(data){
			if(data.result){
				jTips(data.msg);
				location.reload();
			}else{
				jTips(data.msg);
			}
		},'json');	
	} else $('#user_info1').hide();	
});
function cancel_wx_bind() {
	jConfirm('取消绑定后，本微信号将需要重新绑定家长手机号码，是否确定？', '确认对话框', function (r) {
		if (r) {
			$.ajax({
				url: "{php echo $this->createMobileUrl('indexajax',array('op'=>'jzjb'))}",
				data: {sid: "{$it['sid']}", userid: "{$it['id']}", weid: "{$weid}", schoolid: "{$schoolid}", pard: "{$it['pard']}", openid: "{$openid}"},	
				dataType: 'json',
				type: "post",
				success: function (data) {
					jTips(data.msg, function () {
						if(data.result){
							location.href = "{php echo $this->createMobileUrl('bangding',array('schoolid'=> $schoolid))}";
						}
						return true;
					});
				}
			});
		} else {
			return false;
		}
	})
}
</script>  
</body>
</html>

